/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: yang
 * Date: 2022-05-07
 * Time: 14:37
 */
public class Main {
    public static String myToString(int[] nums){
        if(nums == null){
            return "null";
        }

        String ret="[";
        for (int i = 0; i < nums.length; i++) {
            ret += nums[i];
            if(i != nums.length-1)
                ret += ", ";
            else{
                ret += "]";
            }
        }
        return ret;
    }
    public static void main(String[] args) {
        int arr[] = {1,2,3,4,5,6};
        String str = myToString(arr);
        System.out.println(str);
    }
}
